import { createApp } from 'vue';
import './style.css';
import App from './App.vue';
import router from './router';
import api from './api';

const app = createApp(App);

app.config.globalProperties.$api = api;// 在实例上绑定属性

router.beforeEach((to,from) => {
    if(to.path!=='/login'){
        if(!localStorage.getItem('h5_token')){
            return '/login';
        }
    }else{

    }
})

app.use(router);//注册路由

app.mount('#app');
